Skip to content

Conversation

@rina23q
Copy link
Member

@rina23q rina23q commented Sep 15, 2025

Description

With the release of thin-edge.io 1.4.0, custom operation handlers can receive messages via JSON over MQTT with the on_fragment key. As a result, the modbus-plugin no longer needs to define and upload own custom SmartREST template to Cumulocity.

Thus, this PR removes the existing SmartREST implementation and replaces it with the JSON over MQTT feature.
Also, added system tests for c8y_SerialConfiguration operation.

Note

  1. The c8y_Coils and c8y_Registers operation handlers do not appear to be used anywhere. I have modified them to align with this PR's changes, but they remain untested. I assume they are placeholders for supporting write operations.
  2. Probably the test coverage for c8y_ModbusDevice operation (which is created when you add a Modbus-slave from Cumulocity) is missing.

@rina23q rina23q force-pushed the refactor-replace-smartrest-with-devicecontrol branch from 1659e47 to 9c090c0 Compare September 15, 2025 14:01
@rina23q rina23q force-pushed the refactor-replace-smartrest-with-devicecontrol branch from 9c090c0 to 934cb18 Compare September 15, 2025 14:25
@rina23q rina23q force-pushed the refactor-replace-smartrest-with-devicecontrol branch from 934cb18 to 48738b2 Compare September 15, 2025 14:28
@rina23q rina23q marked this pull request as draft September 15, 2025 14:32
@rina23q rina23q force-pushed the refactor-replace-smartrest-with-devicecontrol branch from 48738b2 to 07240a8 Compare September 15, 2025 14:42
@rina23q rina23q temporarily deployed to Test Pull Request September 15, 2025 14:42 — with GitHub Actions Inactive
@rina23q rina23q marked this pull request as ready for review September 15, 2025 14:44
@github-actions
Copy link

github-actions bot commented Sep 15, 2025

Robot Results

✅ Passed ❌ Failed ⏭️ Skipped Total Pass % ⏱️ Duration
19 0 0 19 100 34.622322s

Passed Tests

Name ⏱️ Duration Suite
Device should support the operation c8y_ModbusConfiguration 0.108 s Device
Set values via c8y_ModbusConfiguration Operation 2.360 s Operation
Poll rate and transmit rate should be updated for the Device 0.198 s Operation
Poll rate and transmit rate should be updated on the Device 2.330 s Operation
Device should support the operation c8y_ModbusDevice 0.106 s Device
Device should support the operation c8y_SerialConfiguration 0.107 s Device
Set values via c8y_SerialConfiguration Operation 2.334 s Operation
Serial configuration should be updated for the Device 0.200 s Operation
Serial configuration should be updated on the Device 2.339 s Operation
Device should have installed software tedge-modbus-plugin 0.120 s Debian
Service should be active 2.341 s Debian
ReInstall Modbus Plugin 20.622 s Debian
Device should have the fragment c8y_ModbusConfiguration 0.215 s Device
ChildDevice TestCase1 should be created 0.207 s Device
ChildDevice TestCase1 should have the fragment c8y_ModbusDevice 0.510 s Device
Service tedge-modbus-plugin should be enabled 0.108 s Device
ChildDevice TestCase1 should have a Test.Int16 Measurement 0.210 s Telemetry
ChildDevice TestCase1 should have a Test.Float32 Measurement 0.206 s Telemetry
ChildDevice TestCase1 should have Alarms of type TestAlarm on Coil Value 1 0.001 s Telemetry

@rina23q rina23q force-pushed the refactor-replace-smartrest-with-devicecontrol branch from ba178ea to 65c2f69 Compare September 17, 2025 09:59
@rina23q rina23q force-pushed the refactor-replace-smartrest-with-devicecontrol branch from 65c2f69 to 07c8999 Compare September 17, 2025 10:00
@rina23q rina23q force-pushed the refactor-replace-smartrest-with-devicecontrol branch from 07c8999 to 7af6f67 Compare September 17, 2025 10:03
@rina23q rina23q force-pushed the refactor-replace-smartrest-with-devicecontrol branch from 7af6f67 to a691d13 Compare September 17, 2025 10:04
@rina23q rina23q temporarily deployed to Test Pull Request September 17, 2025 10:04 — with GitHub Actions Inactive
Copy link
Contributor

@reubenmiller reubenmiller left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved

@rina23q rina23q added this pull request to the merge queue Sep 17, 2025
Merged via the queue into thin-edge:main with commit 4ba6ed4 Sep 17, 2025
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants